/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

/**
 *
 * @author admin
 */
public class PanelTambahPinjaman extends JLabel {
    private JLabel labelKodeAnggota;
    private JTextField textKodeAnggota;
    private JLabel labelKodeKoleksi;
    private JTextField textKodeKoleksi;
    private JButton tombolSimpan;
    private JButton tombolBatal;
    
    public PanelTambahPinjaman (){
        setLayout(null);

        labelKodeKoleksi= new JLabel("id Koleksi");
        labelKodeKoleksi.setBounds(20, 130, 100, 20);
        add(labelKodeKoleksi);

        textKodeKoleksi= new JTextField(20);
        textKodeKoleksi.setBounds(110, 130, 130, 25);
        add(textKodeKoleksi);

        labelKodeAnggota= new JLabel("id Anggota");
        labelKodeAnggota.setBounds(18, 160, 120, 40);
        add(labelKodeAnggota);

        textKodeAnggota= new JTextField(20);
        textKodeAnggota.setBounds(110, 170, 130, 25);
        add(textKodeAnggota);

        tombolSimpan= new JButton("Simpan");
        tombolSimpan.setBounds(100, 300, 100, 30);
        add(tombolSimpan);
        tombolSimpan.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                saveCommand();
            }
        });

        tombolBatal= new JButton("Batal");
        tombolBatal.setBounds(240, 300, 100, 30);
        add(tombolBatal);
        tombolBatal.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                cancelCommand();
            }
        });

        this.setSize(500, 400);
        this.setVisible(true);
    }
    
     private void cancelCommand(){
        System.exit(0);
    }

     private void saveCommand(){
        JOptionPane.showMessageDialog(null,"Data Tersimpan");
        System.exit(0);
    }
}

